package mujmail;
import javax.microedition.rms.*;
import java.util.*;
/*
MujMail - Simple mail client for J2ME
Copyright (C) 2005 Pavel Machek <pavel@ucw.cz>
Copyright (C) 2006 Nguyen Son Tung <n.sontung@gmail.com>
Copyright (C) 2006 Martin Stefan <martin.stefan@centrum.cz>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

//this class is used to define native language for labels, texts, buttons and alerts
//use is as Lang.get(Lang.SOMECONST); to get a string in the appropriate language
/**
 * Converts lingual codes used elsewhere in program into associated text.
 * Change string constants in this class to translate mujmail into new language.
 * <p>
 * To obtain string call {@link #get} method. 
 */
public class Lang {

    /******************* Lingual constants for labels and texts ************************/
    //basics constants for whole mujmail
    public static final short MUJMAIL_BASE = 100;
    public static final short EMPTY = MUJMAIL_BASE + 1;
    public static final short FAILED = MUJMAIL_BASE + 2;
    public static final short SUCCESS = MUJMAIL_BASE + 3;
    public static final short IN = MUJMAIL_BASE + 4;
    public static final short ACTIVE = MUJMAIL_BASE + 5;
    public static final short INACTIVE = MUJMAIL_BASE + 6;
    public static final short MSGIDS_CACHE = MUJMAIL_BASE + 7;
    public static final short DB_SPACE_LEFT = MUJMAIL_BASE + 8;
    //account settings constants	
    public static final short AS_ACCOUNTS = MUJMAIL_BASE + 100;
    public static final short AS_ACTIVATION = MUJMAIL_BASE + 101;
    public static final short AS_EMAIL = MUJMAIL_BASE + 102;
    public static final short AS_PROTOCOL = MUJMAIL_BASE + 103;
    public static final short AS_SERVER = MUJMAIL_BASE + 104;
    public static final short AS_PORT = MUJMAIL_BASE + 105;
    public static final short AS_USR_NAME = MUJMAIL_BASE + 106;
    public static final short AS_PASS = MUJMAIL_BASE + 107;
    public static final short AS_PRIMARY = MUJMAIL_BASE + 108;
    public static final short AS_SSL = MUJMAIL_BASE + 109;
    public static final short AS_IMAP_MAILBOXES = MUJMAIL_BASE + 110;
    public static final short AS_COPY_TO_SERVER = MUJMAIL_BASE + 111;
    public static final short AS_COPY_TO_SRV_TRASH = MUJMAIL_BASE + 112;
    public static final short AS_COPY_TO_SRV_SENT = MUJMAIL_BASE + 113;
    public static final short AS_COPY_TO_SRV_TRASH_MAILBOX = MUJMAIL_BASE + 114;
    public static final short AS_COPY_TO_SRV_SENT_MAILBOX = MUJMAIL_BASE + 115;
    public static final short AS_SSL_TYPE = MUJMAIL_BASE + 116;
    public static final short AS_MUJMAIL_SSL = MUJMAIL_BASE + 117;
    public static final short AS_FIRMWARE_SSL = MUJMAIL_BASE + 118;
    public static final short AS_SAME_SETTING_AS_INCOMING = MUJMAIL_BASE + 119;
    public static final short AS_SAME_SETTING = MUJMAIL_BASE + 120;
    public static final short AS_SAME_SETTING_FLAG_AT_IMAP_SERVER = MUJMAIL_BASE + 121;
    //Addressbook constants
    public static final short AD_ADDRESSBOOK = MUJMAIL_BASE + 200;
    public static final short AD_CONTACT_INFO = MUJMAIL_BASE + 201;
    public static final short AD_NAME = MUJMAIL_BASE + 202;
    public static final short AD_EMAIL = MUJMAIL_BASE + 203;
    public static final short AD_NOTES = MUJMAIL_BASE + 204;
    public static final short AD_ADDDING_RCPS = MUJMAIL_BASE + 205;
    //theBox, folders constants
    public static final short TB_FOLDERS = MUJMAIL_BASE + 300;
    public static final short TB_INBOX = MUJMAIL_BASE + 301;
    public static final short TB_OUTBOX = MUJMAIL_BASE + 302;
    public static final short TB_DRAFT = MUJMAIL_BASE + 303;
    public static final short TB_SENTBOX = MUJMAIL_BASE + 304;
    public static final short TB_TRASH = MUJMAIL_BASE + 305;
    public static final short TB_NO_SUBJECT = MUJMAIL_BASE + 306;
    public static final short TB_READ_MAILS = MUJMAIL_BASE + 307;
    public static final short TB_UNREAD_MAILS = MUJMAIL_BASE + 308;
    public static final short TB_ALL_MAILS = MUJMAIL_BASE + 309;
    
    public static final short TB_USERFOLDERS = MUJMAIL_BASE + 310;
    public static final short TB_FOLDER_NAME = MUJMAIL_BASE + 311;
    public static final short TB_RETRIVE_ACCOUNTS = MUJMAIL_BASE + 312;
    public static final short TB_IMAP_FOLDERS = MUJMAIL_BASE + 313;

    //settings constants
    public static final short ST_SETTINGS = MUJMAIL_BASE + 400;
    public static final short ST_SORT_SETTINGS = MUJMAIL_BASE + 401;
    public static final short ST_SORT_BY = MUJMAIL_BASE + 402;
    public static final short ST_SORT_TIME = MUJMAIL_BASE + 403;
    public static final short ST_SORT_SUBJECT = MUJMAIL_BASE + 404;
    public static final short ST_SORT_RECIPIENTS = MUJMAIL_BASE + 405;
    public static final short ST_SORT_SENDER = MUJMAIL_BASE + 406;
    public static final short ST_SORT_SIZE = MUJMAIL_BASE + 407;
    public static final short ST_SORT_ORDER = MUJMAIL_BASE + 408;
    public static final short ST_SORT_INCREASE = MUJMAIL_BASE + 409;
    public static final short ST_SORT_DECREASE = MUJMAIL_BASE + 410;
    public static final short ST_LANG = MUJMAIL_BASE + 411;
    public static final short ST_SMTP_AUTH = MUJMAIL_BASE + 414;
    public static final short ST_SMTP_AUTH_NEEDED = MUJMAIL_BASE + 415;
    public static final short ST_DOWN_WHOLE_MAIL = MUJMAIL_BASE + 418;
    public static final short ST_DEL_FROM_SERVER = MUJMAIL_BASE + 419;
    public static final short ST_ADD_TO_ADBOOK = MUJMAIL_BASE + 420;
    public static final short ST_NOT_SET = MUJMAIL_BASE + 421;
    public static final short ST_POLLING_INTERVAL = MUJMAIL_BASE + 422;
    public static final short ST_TIMEOUT = MUJMAIL_BASE + 423;
    public static final short ST_SIGN = MUJMAIL_BASE + 424;
    public static final short ST_OTHER = MUJMAIL_BASE + 425;
    public static final short ST_POLLING_BEHAVIOUR = MUJMAIL_BASE + 426;
    public static final short ST_POLLING_PLAY_SOUND = MUJMAIL_BASE + 427;
    public static final short ST_POLLING_DOWN = MUJMAIL_BASE + 428;
    public static final short ST_DEL_ON_EXIT = MUJMAIL_BASE + 429;
    public static final short ST_ML_SMALL_FONT = MUJMAIL_BASE + 430;
    public static final short ST_TICK_TEXT = MUJMAIL_BASE + 431;
    public static final short ST_SAFE_MODE = MUJMAIL_BASE + 432;
    public static final short ST_RETR_MAX_MAILS = MUJMAIL_BASE + 433;
    public static final short ST_SORT_RECORD_ID = MUJMAIL_BASE + 434;
    public static final short ST_REPLACE_TABS = MUJMAIL_BASE + 435;
    public static final short ST_MOVE_TO_TRASH = MUJMAIL_BASE + 436;
    public static final short ST_DOWNLOAD_ONLY_NEVER_SEEN = MUJMAIL_BASE + 438;
    public static final short ST_AUTO_CLEAR_INBOX = MUJMAIL_BASE + 439;
    public static final short ST_RETR_MAX_LINES = MUJMAIL_BASE + 440;
    public static final short ST_FONT_SIZE = MUJMAIL_BASE + 441;
    public static final short ST_FONT_NORMAL = MUJMAIL_BASE + 442;
    public static final short ST_FONT_LARGE = MUJMAIL_BASE + 443;
    public static final short ST_MUJMAIL_SRV_ADDRESS = MUJMAIL_BASE + 444;
    public static final short ST_MUJMAIL_SRV_PORT = MUJMAIL_BASE + 445;
    public static final short ST_MUJMAIL_SRV_LOGIN = MUJMAIL_BASE + 446;
    public static final short ST_MUJMAIL_SRV_PSWD = MUJMAIL_BASE + 447;
    public static final short ST_SMTP =  MUJMAIL_BASE + 448;
    public static final short ST_PRIMARY_MAIL = MUJMAIL_BASE + 449;

      /** Code for English text "Threading" in sort form */
    public static final short ST_THREADING = MUJMAIL_BASE + 450;
      /** Code for English text "enable" in sort form */
    public static final short ST_THREADING_ENABLE = MUJMAIL_BASE + 451;
      /** Code for English text "show roots" in sort form */
    public static final short ST_ROOTS_VISIBLE = MUJMAIL_BASE + 452;
    public static final short ST_TASK_MANAGER = MUJMAIL_BASE + 453;
    public static final short ST_START_SIMPLE_TASK = MUJMAIL_BASE + 454;

    //mail concerning constants
    public static final short ML_TO = MUJMAIL_BASE + 500;
    public static final short ML_SUBJECT = MUJMAIL_BASE + 501;
    public static final short ML_BODY = MUJMAIL_BASE + 502;
    public static final short ML_FROM = MUJMAIL_BASE + 503;
    public static final short ML_ATTACHMENTS = MUJMAIL_BASE + 504;
    public static final short ML_SIZE = MUJMAIL_BASE + 505;
    public static final short ML_TIME = MUJMAIL_BASE + 506;
    public static final short ML_HEADERS_DETAIL = MUJMAIL_BASE + 507;
    public static final short ML_ATTCHMENTS_DETAIL = MUJMAIL_BASE + 508;
    public static final short ML_FILENAME = MUJMAIL_BASE + 509;
    public static final short ML_WIDTH = MUJMAIL_BASE + 510;
    public static final short ML_HEIGHT = MUJMAIL_BASE + 511;
    public static final short ML_RECIPIENTS = MUJMAIL_BASE + 512;
    public static final short ML_FILE_WILL_OR_WAS_ATTACHED = MUJMAIL_BASE + 513;
    public static final short ML_MAIL_ACCOUNT = MUJMAIL_BASE + 514;
    public static final short ML_MAIL_RETRIVIEVING_MAILS = MUJMAIL_BASE + 515;
    public static final short ML_MAIL_SENDING_MAILS = MUJMAIL_BASE + 516;
    //FileSystem browser constants
    //#ifdef MUJMAIL_FS
    public static final short FS_BROWSER_SELECT_FILE = MUJMAIL_BASE + 600;
    public static final short FS_BROWSER_SELECT_DIR = MUJMAIL_BASE + 601;
    public static final short FS_BROWSER_ENTER_FILE_NAME = MUJMAIL_BASE + 602;
    public static final short FS_BROWSER_ENTER_DIR_NAME = MUJMAIL_BASE + 603;
    //#endif
    //Configuration synchronization constants
    //#ifdef MUJMAIL_SYNC
//#     public static final short SYNC_SELECT_MODE = MUJMAIL_BASE + 700;
//#     public static final short SYNC_MODE_LOCAL = MUJMAIL_BASE + 701;
//#     public static final short SYNC_MODE_REMOTE = MUJMAIL_BASE + 702;
    //#endif
    //Search constants
    //#ifdef MUJMAIL_SEARCH
    public static final short EXTRA_SEA_SEARCHING = MUJMAIL_BASE + 800;
    public static final short EXTRA_SEA_SEARCH_RESULTS = MUJMAIL_BASE + 801;
    public static final short EXTRA_SEA_SEARCHING_IN_BOX = MUJMAIL_BASE + 802;
    public static final short EXTRA_SEA_ADVANCED_SETTINGS = MUJMAIL_BASE + 803;
    public static final short EXTRA_SEA_DATE_INTERVAL = MUJMAIL_BASE + 804;
    public static final short EXTRA_SEA_DATE_FROM = MUJMAIL_BASE + 805;
    public static final short EXTRA_SEA_DATE_TO = MUJMAIL_BASE + 806;
    public static final short EXTRA_SEA_SEARCH_IN_MAILBOXES = MUJMAIL_BASE + 807;
    public static final short EXTRA_SEA_ENTER_SEARCH_PHRASE = MUJMAIL_BASE + 808;
    public static final short EXTRA_SEA_SEARCH_PHRASE = MUJMAIL_BASE + 809;
    public static final short EXTRA_SEA_REQUIRED = MUJMAIL_BASE + 810;
    public static final short EXTRA_SEA_WHOLE_WORDS = MUJMAIL_BASE + 811;
    public static final short EXTRA_SEA_SEARCH_IN_MSG_PARTS = MUJMAIL_BASE + 812;
    public static final short EXTRA_ALL_PHARSE_MUST_MATCH_WORDS = MUJMAIL_BASE + 813;
    //#endif
    //Utilities constants
    public static final short UT_UTILS = MUJMAIL_BASE + 900;
    public static final short UT_TASKS_PROGRESS_BAR = MUJMAIL_BASE + 901;
    //Menu Actions constants
    public static final short AC_ACTIONS = MUJMAIL_BASE + 1000;
    public static final short AC_WRITE_MAIL = MUJMAIL_BASE + MUJMAIL_BASE + 1001;
    public static final short AC_RETRIEVE_MAILS = MUJMAIL_BASE + MUJMAIL_BASE + 1002;
    public static final short AC_SENDALL = MUJMAIL_BASE + MUJMAIL_BASE + 1003;
    public static final short AC_POLLING = MUJMAIL_BASE + MUJMAIL_BASE + 1004;
    public static final short AC_FORWARD = MUJMAIL_BASE + MUJMAIL_BASE + 1005;
    public static final short AC_CLEAR_DB = MUJMAIL_BASE + MUJMAIL_BASE + 1006;
    public static final short AC_DISCONNECT = MUJMAIL_BASE + MUJMAIL_BASE + 1007;
    public static final short AC_SERVERS_INBOX_SYNC = MUJMAIL_BASE + MUJMAIL_BASE + 1008;
    public static final short AC_BACKUP_SETTINGS = MUJMAIL_BASE + MUJMAIL_BASE + 1009;
    public static final short AC_RESTORE_SETTINGS = MUJMAIL_BASE + MUJMAIL_BASE + 1010;
    //#ifdef MUJMAIL_SEARCH
    public static final short EXTRA_AC_SEARCH_MAILS = MUJMAIL_BASE + MUJMAIL_BASE + 1011;
    //#endif
    public static final short AC_PUSH = MUJMAIL_BASE + MUJMAIL_BASE + 1012;
    //About constants
    public static final short ABT_ABOUT = MUJMAIL_BASE + 1050;
    public static final short ABT_TEXT = MUJMAIL_BASE + 1051;
    // Debug constants
    public static final short DEB_MENU = MUJMAIL_BASE + 1060;
    
    //Sendmails constants
    public static final short SM_FORWARDED_MESSAGE = MUJMAIL_BASE + 1080;
    public static final short SM_SENDING_ACCOUNT = MUJMAIL_BASE + 1081;
    public static final short SM_ATTACHMENT = MUJMAIL_BASE + 1082;
    public static final short SM_FILE_SIZE = MUJMAIL_BASE + 1083;
    public static final short SM_EDIT_BODY = MUJMAIL_BASE + 1084;
    //protocols constants
    public static final short PL_NOTAUTHORIZED = MUJMAIL_BASE + 1150;
    /******************* Lingual constants for buttons  ************************/
    //basic buttons constants			
    public static final short BTN_BASE = 5000;
    public static final short BTN_OK = BTN_BASE + 1;
    public static final short BTN_CANCEL = BTN_BASE + 2;
    public static final short BTN_BACK = BTN_BASE + 3;
    public static final short BTN_CLEAR = BTN_BASE + 4;
    public static final short BTN_SAVE = BTN_BASE + 5;
    public static final short BTN_EDIT = BTN_BASE + 10;
    public static final short BTN_DELETE = BTN_BASE + 11;
    public static final short BTN_DEL_UNDEL = BTN_BASE + 12;
    public static final short BTN_EXIT = BTN_BASE + 13;
    public static final short BTN_RTV_NEW_MAILS = BTN_BASE + 14;
    public static final short BTN_SELECT = BTN_BASE + 15;
    public static final short BTN_CLR = BTN_BASE + 16;
    public static final short BTN_CONFIRM = BTN_BASE + 17;
    public static final short BTN_BOUNCE = BTN_BASE + 18;
    //buttons for addressbook
    public static final short BTN_AD_MARK = BTN_BASE + 100;
    public static final short BTN_AD_UNMARK = BTN_BASE + 101;
    public static final short BTN_AD_DONE = BTN_BASE + 102;
    public static final short BTN_AD_SEND_MAIL = BTN_BASE + 103;
    public static final short BTN_AD_ADD_NEW = BTN_BASE + 104;
    public static final short BTN_AD_VIEW = BTN_BASE + 105;
    public static final short BTN_AD_FLIPRCP = BTN_BASE + 106;
    //thebox, folders buttons
    public static final short BTN_TB_VIEW_MESS = BTN_BASE + 200;
    public static final short BTN_TB_FORWARD = BTN_BASE + 201;
    public static final short BTN_TB_DEL_NOW = BTN_BASE + 202;
    public static final short BTN_TB_SORT = BTN_BASE + 203;
    public static final short BTN_TB_STOP = BTN_BASE + 204;
    public static final short BTN_TB_MARK_SEEN = BTN_BASE + 205;
    public static final short BTN_TB_MARK_FLAGGED = BTN_BASE + 206;
    public static final short BTN_TB_CONVERTING_BODYPART = BTN_BASE + 207;
    //inbox
    public static final short BTN_TB_REPLY = BTN_BASE + 215;
    public static final short BTN_TB_QUOTED_REPLY = BTN_BASE + 216;
    public static final short BTN_TB_REDOWNLOAD = BTN_BASE + 217;
    public static final short BTN_TB_REPLY_ALL = BTN_BASE + 218;
    public static final short BTN_TB_REDOWNLOAD_MAIL_BODY = BTN_BASE + 219;
    //outboxs
    public static final short BTN_OB_SEND = BTN_BASE + 220;
    public static final short BTN_OB_SENDALL = BTN_BASE + 221;
    //trash
    public static final short BTN_TR_RESTORE = BTN_BASE + 230;
    public static final short BTN_TR_RESTORE_NOW = BTN_BASE + 231;
    //sendmail
    public static final short BTN_SM_SEND = BTN_BASE + 300;
    public static final short BTN_SM_USE_AB = BTN_BASE + 301;
    public static final short BTN_SM_SEND_LATTER = BTN_BASE + 302;
    public static final short BTN_SM_SAVE = BTN_BASE + 303;
    public static final short BTN_SM_BC = BTN_BASE + 304;
    public static final short BTN_SM_CLEAR = BTN_BASE + 305;
    public static final short BTN_SM_CHOOSE_FROM = BTN_BASE + 306;
    public static final short BTN_SM_ADD_ATTACHMENT = BTN_BASE + 307;
    public static final short BTN_SM_MODIFY_ATTACHMENT = BTN_BASE + 308;
    public static final short BTN_SM_REMOVE_ATTACHMENT = BTN_BASE + 309;
    public static final short BTN_SM_EDIT_BODY_FULLSCREEN = BTN_BASE + 310;
    public static final short BTN_SM_UPDATE_BODY = BTN_BASE + 311;
    public static final short BTN_SM_CANCEL_BODY = BTN_BASE + 312;
    public static final short BTN_SM_REMOVE_ALL_ATTACHMENTS = BTN_BASE + 313;
    public static final short BTN_SM_PREVIEW = BTN_BASE + 314;
    //account settings 
    public static final short BTN_AS_NEW = BTN_BASE + 400;
    public static final short BTN_AS_SET_PRIMARY = BTN_BASE + 401;
    //mailform
    public static final short BTN_MF_ATTACHMENTS = BTN_BASE + 500;
    public static final short BTN_MF_HEADERS_DETAILS = BTN_BASE + 501;
    public static final short BTN_MF_EMAIL_ADDRS = BTN_BASE + 502;
    public static final short BTN_MF_DEL_ATTACHMENTS = BTN_BASE + 503;
    public static final short BTN_MF_DETAILS = BTN_BASE + 504;
    public static final short BTN_MF_ADD_EMAIL = BTN_BASE + 505;
    public static final short BTN_MF_REDOWN_ATTACHMENTS = BTN_BASE + 506;
    //#ifdef MUJMAIL_FS
    public static final short BTN_MF_EXPORT_MAIL_TO_FS = BTN_BASE + 507;
    //#endif
    public static final short BTN_MF_DISPLAY_AS_TEXT = BTN_BASE + 508;
    public static final short BTN_MF_EXPORT_BP_TO_FS = BTN_BASE + 509;
    public static final short BTN_MF_VIEW_CONVERTED = BTN_BASE + 510;
    //search
    //#ifdef MUJMAIL_SEARCH
    public static final short EXTRA_BTN_SEA_NEW_SEARCH = BTN_BASE + 530;
    public static final short EXTRA_BTN_SEA_STOP_SEARCH = BTN_BASE + 531;
    public static final short EXTRA_BTN_SEA_SEARCH = BTN_BASE + 532;
    public static final short EXTRA_BTN_SEA_ADD_NEW_PHRASE = BTN_BASE + 533;
    //#endif    
    
    //filesystem browser
    //#ifdef MUJMAIL_FS
    public static final short BTN_FS_CREATE_DIR = BTN_BASE + 540;
    //#endif
    //about
    public static final short BTN_ABT_FEEDBACK = BTN_BASE + 550;

    //user folders
    //#ifdef MUJMAIL_USR_FOLDERS
    public static final short EXTRA_BTN_USR_FLD_ADD = BTN_BASE + 560;
    //#endif
    /******************* Lingual constants for alerts & activity reports ************************/
    //basic alerts
    public static final short ALRT_BASE = 10000;
    public static final short ALRT_WAIT = ALRT_BASE + 1;
    public static final short ALRT_LOADING = ALRT_BASE + 2;
    public static final short ALRT_SAVING = ALRT_BASE + 3;
    public static final short ALRT_DELETING = ALRT_BASE + 4;
    public static final short ALRT_BAD_EMAIL = ALRT_BASE + 5;
    public static final short ALRT_SORTING = ALRT_BASE + 6;
    public static final short ALRT_INITIATING = ALRT_BASE + 7;
    public static final short ALRT_SYNCHRONIZING = ALRT_BASE + 8;
    public static final short ALRT_NEW_MAILS = ALRT_BASE + 9;
    //settings
    public static final short ALRT_ST_SAVING = ALRT_BASE + 50;
    public static final short ALRT_ST_LOADING = ALRT_BASE + 51;

    //sendmail	
    public static final short ALRT_SM_NO_RCP = ALRT_BASE + 100;
    public static final short ALRT_SM_CAN_NOT_ATTACH_BODY = ALRT_BASE + 101;
    //inprotocols
    public static final short ALRT_INPL_NO_LONGER_ON_SERVER = ALRT_BASE + 150;
    public static final short ALRT_INPL_CHECK_MAILS = ALRT_BASE + 151;
    public static final short ALRT_INPL_DEL_MAILS = ALRT_BASE + 152;
    public static final short ALRT_INPL_DOWN_MAIL = ALRT_BASE + 153;
    public static final short ALRT_INPL_NEWMAILS = ALRT_BASE + 154;
    public static final short ALRT_INPL_REDOWN_MAIL = ALRT_BASE + 155;
    public static final short ALRT_INPL_IMAP_CANNOT_SELECT_MAILBOX = ALRT_BASE + 156;
    public static final short ALRT_INPL_IMAP_UIDVALIDITY_DIFFERS = ALRT_BASE + 157;
    public static final short ALRT_INPL_IMAP_GETURL_NO_PAGE = ALRT_BASE + 158;
    public static final short ALRT_INPL_SAVE_SRV_SENT = ALRT_BASE+159; 
        
    //concerning the system
    public static final short ALRT_SYS_BUSY = ALRT_BASE + 200;
    public static final short ALRT_SYS_DEL_ALL_CONFIRM = ALRT_BASE + 201;
    public static final short ALRT_SYS_NO_DBSPACE = ALRT_BASE + 202;
    public static final short ALRT_SYS_CHECK_COM_SETTINGS = ALRT_BASE + 203;
    public static final short ALRT_SYS_SHUTDOWN_CONFIRM = ALRT_BASE + 204;
    public static final short ALRT_SYS_PROCESS_INTERRUPTED = ALRT_BASE + 205;
    public static final short ALRT_SYS_EXCEPTION_AROSED = ALRT_BASE + 206;
    public static final short ALRT_SYS_LOW_MEMORY = ALRT_BASE + 207;
    public static final short ALRT_SYS_DEL_CONFIRM = ALRT_BASE + 208;
    public static final short ALRT_SYS_TASK_FINISHED = ALRT_BASE + 209;
    //mailform
    public static final short ALRT_MF_LOAD_BODY = ALRT_BASE + 250;
    public static final short ALRT_MF_VIEW_ATT = ALRT_BASE + 251;
    public static final short ALRT_MF_NO_TEXT = ALRT_BASE + 252;
    public static final short ALRT_MF_NO_ATTACHMENTS = ALRT_BASE + 253;
    public static final short ALRT_MF_DEL_ATT = ALRT_BASE + 254;
    public static final short ALRT_MF_UNSUPPORTED_FORMAT = ALRT_BASE + 255;
    public static final short ALRT_MF_SAVE_CNTS = ALRT_BASE + 256;
    public static final short ALRT_MF_NO_VIEWABLE_BODY = ALRT_BASE + 257;
    public static final short ALRT_MF_UNSUPPORTED_CONVERSION = ALRT_BASE + 258;
    //account settings alert
    public static final short ALRT_AS_NONEXIST = ALRT_BASE + 300;
    public static final short ALRT_AS_NO_ACCOUNT_SET_ACTIVE = ALRT_BASE + 301;
    public static final short ALRT_AS_LOAD = ALRT_BASE + 302;
    public static final short ALRT_AS_ALREADY_EXITS = ALRT_BASE + 303;
    public static final short ALRT_AS_SET_DEFAULT_ACCOUNT = ALRT_BASE + 304;
    //adressbook
    public static final short ALRT_AD_LOAD = ALRT_BASE + 400;
    public static final short ALRT_AD_DELETE = ALRT_BASE + 401;
    //protocol concerning constants
    public static final short ALRT_PL_CONNECTING = ALRT_BASE + 500;
    public static final short ALRT_PL_CLOSING = ALRT_BASE + 501;
    public static final short ALRT_PL_CLOSSING = ALRT_BASE + 502;
    //SMTP constants
    public static final short ALRT_SMTP_SENDING = ALRT_BASE + 600;
    // Mobile abilities warnings
    public static final short ALRT_MOB_JSR75 = ALRT_BASE + 650;
    //Malboxes exceptions
    public static final short ALRT_MB_CREATING = ALRT_BASE + 700;
    
    /******************* Lingual constants for Exceptions  ************************/
    public static final short EXP_BASE = 12000;
    //!!! The offset of these values must be corresponding to the offset defined in MyException class
    //ie: LANG.EXP_COM_BASE = 1 (+ EXP_BASE)
    //   MYEXCEPTION.COM_BASE = 1	
    //in this example both offsets are 1
    public static final short EXP_COM_BASE = EXP_BASE + 1;
    public static final short EXP_COM_IN = EXP_COM_BASE + 1;
    public static final short EXP_COM_OUT = EXP_COM_BASE + 2;
    public static final short EXP_COM_TIMEOUT = EXP_COM_BASE + 3;
    public static final short EXP_COM_HALTED = EXP_COM_BASE + 4;
    public static final short EXP_COM_UNKNOWN = EXP_COM_BASE + 5;
    public static final short EXP_SYSTEM_BASE = EXP_BASE + 10;
    public static final short EXP_SYS_OUT_OF_MEMORY = EXP_SYSTEM_BASE + 1;
    public static final short EXP_SYS_IMAGE_FAILED = EXP_SYSTEM_BASE + 2;
    public static final short EXP_PROTOCOL_BASE = EXP_BASE + 20;
    public static final short EXP_PROTOCOL_CANNOT_CONNECT = EXP_PROTOCOL_BASE + 1;
    public static final short EXP_PROTOCOL_CANNOT_RETRIEVE_BODY = EXP_PROTOCOL_BASE + 2;
    public static final short EXP_PROTOCOL_COMMAND_NOT_EXECUTED = EXP_PROTOCOL_BASE + 3;
    public static final short EXP_PROTOCOL_CANNOT_DELETE_MAILS = EXP_PROTOCOL_BASE + 4;
    public static final short EXP_PROTOCOL_DELETING_MAILS = EXP_PROTOCOL_BASE + 5;
    public static final short EXP_VARIOUS_BASE = EXP_BASE + 30;
    public static final short EXP_VARIOUS_BAD_EMAIL = EXP_VARIOUS_BASE + 1;
    public static final short EXP_VARIOUS_AB_MULTIPLE_ENTRIES = EXP_VARIOUS_BASE + 2;
    public static final short EXP_VARIOUS_DECODE_ILLEGAL_MIME = EXP_VARIOUS_BASE + 3;
    //#ifdef MUJMAIL_FS
    public static final short EXP_FS_BASE = EXP_BASE + 40;
    public static final short EXP_FS_IO_ERROR = EXP_FS_BASE + 1;
    public static final short EXP_FS_FILE_EXISTS = EXP_FS_BASE + 2;
    public static final short EXP_FS_CLOSE_FILE = EXP_FS_BASE + 3;
    public static final short EXP_FS_OPEN_FILE = EXP_FS_BASE + 4;
    public static final short EXP_FS_FILE_READ_ERROR = EXP_FS_BASE + 5;
    //#endif
    public static final short EXP_DB_BASE = EXP_BASE + 50;
    public static final short EXP_DB_NOSPACE = EXP_DB_BASE + 1;
    public static final short EXP_DB_CANNOT_CLEAR = EXP_DB_BASE + 2;
    public static final short EXP_DB_CANNOT_SAVE_BODY = EXP_DB_BASE + 3;
    public static final short EXP_DB_CANNOT_SAVE_HEADER = EXP_DB_BASE + 4;
    public static final short EXP_DB_CANNOT_DEL_HEADER = EXP_DB_BASE + 5;
    public static final short EXP_DB_CANNOT_DEL_BODY = EXP_DB_BASE + 6;
    public static final short EXP_DB_CANNOT_DEL_MAIL = EXP_DB_BASE + 7;
    public static final short EXP_DB_CANNOT_LOAD_BODY = EXP_DB_BASE + 8;
    public static final short EXP_DB_CANNOT_LOAD_CONTACT = EXP_DB_BASE + 9;
    public static final short EXP_DB_CANNOT_SAVE_CONTACT = EXP_DB_BASE + 10;
    public static final short EXP_DB_CANNOT_DEL_CONTACT = EXP_DB_BASE + 11;
    public static final short EXP_DB_CANNOT_UPDATE_HEADER = EXP_DB_BASE + 12;
    public static final short EXP_DB_CANNOT_LOAD_SETTINGS = EXP_DB_BASE + 13;
    public static final short EXP_DB_CANNOT_SAVE_SETTINGS = EXP_DB_BASE + 14;
    public static final short EXP_DB_CANNOT_LOAD_ACCOUNTS = EXP_DB_BASE + 15;
    public static final short EXP_DB_CANNOT_SAVE_ACCOUNT = EXP_DB_BASE + 16;
    public static final short EXP_DB_CANNOT_DELETE_ACCOUNT = EXP_DB_BASE + 17;
    public static final short EXP_DB_CANNOT_OPEN_DB = EXP_DB_BASE + 18;
    public static final short EXP_DB_CANNOT_LOAD_HEADERS = EXP_DB_BASE + 19;
    public static final short EXP_DB_CANNOT_CLOSE_DB = EXP_DB_BASE + 20;
    public static final short EXP_DB_CANNOT_SAVE_MSGID = EXP_DB_BASE + 21;
    public static final short EXP_DB_CANNOT_LOAD_MSGID = EXP_DB_BASE + 22;
    public static final short EXP_DB_CANNOT_DEL_MSGID = EXP_DB_BASE + 23;
    public final static short EXP_DB_CANNOT_SAVE = EXP_DB_BASE + 24;
    public final static short EXP_DB_CANNOT_DEL = EXP_DB_BASE + 25;

    //the main method of the class, is used to get the appropriate lingual string
    /**
     * Converts Lingual codes into strings.
     * @param lang_code Code to be converted into string.
     * @return Text associtated with code.
     */
    static final byte LANG_UNDEFINED=-1;
    static final byte LANG_EN=0;
    static final byte LANG_CN=LANG_EN+1;
    static final byte LANG_CZ=LANG_CN+1;
    static final byte LANG_DE=LANG_CZ+1;
    static final byte LANG_ES=LANG_DE+1;
    static final byte LANG_HU=LANG_ES+1;
    static final byte LANG_IT=LANG_HU+1;
    static final byte LANG_PL=LANG_IT+1;
    static final byte LANG_SK=LANG_PL+1;
    static final byte MAX_LANG = LANG_SK+1;
    private static final String[] langLocales ={"en","cn","cz","de","es","hu","it","pl","sk"};
    public static final String[] AVAILABLE_LANGUAGES =
    {
        "English",
    "Chinese",
    "German",
    "Spanish",
     "HU",
     "Italian",
     "Polish",
     "SK"
    };
    public static final String[] getAvaliableLanguages()
    {
        return new String[]{
            get(LANG_EN),
          //  get(LANG_CN),
          //  get(LANG_CZ),
          //  get(LANG_DE),
          //  get(LANG_ES),
          //  get(LANG_HU),
         //   get(LANG_IT),
         //   get(LANG_PL),
         //   get(LANG_SK)
            };
    }

    public static void saveLang()
    {
        RecordStore rs=null;
		try{
			rs= RecordStore.openRecordStore("lang_setting",false);
            RecordEnumeration re  = rs.enumerateRecords(null,null, false);
            if(re.hasNextElement())
            {
                int recordId=re.nextRecordId();
                System.out.println("Writing to recoeed id: "+recordId+" Value="+Settings.langId);
                rs.setRecord(recordId, new byte[]{Settings.langId}, 0, 1);

            }
            else
            {
                int recordId=rs.addRecord(new byte[]{Settings.langId}, 0, 1);
                System.out.println("Record added in"+recordId);
            }
		}
        catch(Exception e)
        {

        }
        finally {
            try{
                if(rs!=null)
                    rs.closeRecordStore();
            }
            catch(Exception e )
            {

            }
        }
    }
    public static void loadSavedLang()
    {
        RecordStore rs=null;
		try{
			rs= RecordStore.openRecordStore("lang_setting",true);
            RecordEnumeration re  = rs.enumerateRecords(null,null, false);
            if(re.hasNextElement())
            {
              
              
                Settings.langId=re.nextRecord()[0];
                 System.out.println("Just read: "+Settings.langId+"From "+re.previousRecordId());
            }
		}
        catch(Exception e)
        {

        }
        finally {
            try{
                if(rs!=null)
                    rs.closeRecordStore();
            }
            catch(Exception e )
            {

            }
        }
        setCurrentLanguage(Settings.langId);
    }


	    
	static private byte currentLanguage=LANG_UNDEFINED;
    public static void setCurrentLanguage(byte lang)
    {
        if(currentLanguage==LANG_UNDEFINED && lang>LANG_UNDEFINED && lang< MAX_LANG)
            currentLanguage=lang;
    }

    public static byte getCurrentLanguage()
    {
        return currentLanguage;
    }

    public static String getLocaleString()
    {
        if(Settings.langId<0 || Settings.langId>langLocales.length)
            return "en";
        return langLocales[Settings.langId];
    }
    public static String get(short lang_code) {
        //return LangEN.get(lang_code);
        switch(currentLanguage)
        {
            case LANG_EN:return LangEN.get(lang_code);
            case LANG_ES:return LangES.get(lang_code);
            case LANG_HU:return LangHU.get(lang_code);
            case LANG_IT:return LangIT.get(lang_code);
            case LANG_CN:return LangCN.get(lang_code);
            case LANG_CZ:return LangCZ.get(lang_code);
            case LANG_DE:return LangDE.get(lang_code);
            case LANG_PL:return LangPL.get(lang_code);
            case LANG_SK:return LangSK.get(lang_code);
        }
        return "Language ID:"+currentLanguage+" not defined.";

    }

public static final short	EXTRA_ACCOUNT_FORM	=	-1000	;
public static final short	EXTRA_SAME_SETTING_AS_INCOMING	=	-999	;
public static final short	EXTRA_SAME_SETTING	=	-998	;
public static final short	EXTRA_SAME_SETTING_FLAG_AT_IMAP_SERVER	=	-997	;
public static final short	EXTRA_CONVERTING_BODYPART	=	-996	;
public static final short	EXTRA_TB_REDOWNLOAD_MAIL_BODY	=	-995	;
public static final short	EXTRA_REMOVING_MAILS	=	-994	;
public static final short	EXTRA_CLOSSING_CONNECTION	=	-993	;
public static final short	EXTRA_SAVING_SENT_FOLDER	=	-992	;
public static final short	EXTRA_ERROR	=	-991	;
public static final short	EXTRA_OTHER	=	-990	;
public static final short	EXTRA_BOUNCE	=	-989	;
public static final short	EXTRA_STORING_MAIL_SETTINGS	=	-988	;
public static final short	EXTRA_STORING_MAILS	=	-987	;
public static final short	EXTRA_TASK_MANAGER	=	-986	;
public static final short	EXTRA_START_SAMPLE_TASK	=	-985	;
public static final short	EXTRA_RETRIVIEVING_MAILS	=	-984	;
public static final short	EXTRA_RETRIVIEVING_MAILS_SETTING	=	-983	;
public static final short	EXTRA_DELETE_MAILS_CANNOT_SAVE_HEADER	=	-982	;
public static final short	EXTRA_DELETEBODYPART_CANNOT_SAVE_BODYPART	=	-981	;
public static final short	EXTRA_OTHER_SETTINGS	=	-980	;
public static final short	EXTRA_PASSWORD	=	-979	;
public static final short	EXTRA_THERE_IS_INCOMPLETED_TASK	=	-978	;
public static final short	EXTRA_TOTAL_ATTCHMENT_SIZE	=	-977	;
public static final short	EXTRA_ONLY_UPTO_50KB	=	-976	;
public static final short	EXTRA_SHOW_RUNNING	=	-975	;
public static final short	EXTRA_SHOW_WAITING	=	-974	;
public static final short	EXTRA_PROGRESS	=	-973	;
public static final short	EXTRA_WAITING_FOR_START	=	-972	;
public static final short	EXTRA_RUNNING_TASKS	=	-971	;
public static final short	EXTRA_CANCEL_STARTING	=	-970	;
public static final short	EXTRA_SOME_TASKS_ARE_RUNNING	=	-969	;
public static final short	EXTRA_EXIT_ANYWAY	=	-968	;
public static final short	EXTRA_THERE_ARE_BIG	=	-967	;
public static final short	EXTRA_THE_TASK_WILL_BE	=	-966	;
public static final short	EXTRA_LANGUAGE	=	-965	;
public static final short	EXTRA_SETTINGS	=	-964	;
public static final short	EXTRA_SAMPLE_TASK	=	-963	;
public static final short	EXTRA_OPTIONS	=	-962	;
public static final short	EXTRA_MAX_SIZE_BODYPART	=	-961	;
public static final short	EXTRA_SHOW_TASKS	=	-960	;
public static final short	EXTRA_GETTING_NEW_MAILS	=	-959	;
public static final short	EXTRA_RETIEVING_MAIL_BODY	=	-958	;
public static final short   EXTRA_LAN_SETTING_EFFECT_REBOOT = -957;
public static final short   EXTRA_START_POLLING = -956;
public static final short   EXTRA_STOP_POLLING = -955;
public static final short   EXTRA_TB_USERFOLDERS = -954;
public static final short   EXTRA_ML_MAIL_RETRIVIEVING_MAILS = -953;
public static final short   EXTRA_INITIALIZING = -952;
public static final short   EXTRA_SONIMAIL = -951;
public static final short   EXTRA_WRONG_PASSWORD = -950;
public static final short   EXTRA_DELETE_CONFIRMATION = -949;
public static final short   EXTRA_SHOULD_BE_BETWEEN = -948;
public static final short   EXTRA_DELETING = -947;
public static final short   EXTRA_ONLY_PARTIAL = -946;
public static final short   EXTRA_NEWER_FIRST = -945;
public static final short   EXTRA_OLDER_FIRST = -944;
public static final short   EXTRA_POLLING_INTERVAL_MUST_BE = -943;

public static final short   EXTRA_YOUR_TIMEZONE = -942;
public static final short   EXTRA_GMT = -941;
public static final short   EXTRA_FOLDER_SETTINGS = -940;
public static final short   EXTRA_YOU_CAN_FIND_THIS_FILE = -939;
public static final short   EXTRA_FILE_TYPE_NOT_SUPPORTED = -938;
public static final short   EXTRA_MSG_TRUCATED = -937;
public static final short   EXTRA_MENU = -936;
public static final short   EXTRA_DATE = -935;
public static final short   EXTRA_REPLY_TO = -934;
public static final short   EXTRA_RECEIVE_MAIL_WHEN_LAUNCH = -933;

}
